home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 March / macformat-022.iso / Shareware City / Developers / SW Demo / Demo Source / Main.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-09  |  2.5 KB  |  75 lines  |  [TEXT/MPCC]

  1. // ----------------------------------------------------------------------------------
  2. // Main.c
  3. // ----------------------------------------------------------------------------------
  4. // Main loop.
  5. //
  6. // This program is a quick and dirty demo I put together in between working on
  7. // the regular spell checker and the more complete demos I'm putting together.
  8. // The problem with the more complete demos is that they are fairly complicated.
  9. // The advantage of the demo is that while it is very unpolished, you can actually
  10. // figure out what is going on.  This demo will get better with time as I add new
  11. // features.  The big new feature to be added is the SpellWright Interface Libaray.
  12. // Right now I roll my own interface.  This is actually probably a good thing as it
  13. // give you an idea of how to put together an interface.  I don't use most of the
  14. // features of SpellWright, but that is OK.  There is an other demo, APIDemo that
  15. // actually shows how to utilize each feature of SpellWright, but it uses stdio for
  16. // clarity and speed (and portability).  
  17. //
  18. // This demo is copywrite 1994 by LexTek Internation.  Feel free to use it for
  19. // whatever purpose you wish.  The SpellWright Library may not be copied or 
  20. // distributed, except when linked to your application that adds significant features
  21. // to the code.  ie. you can't take the library, make a new library and sell it.  You
  22. // can, however, use it without royalties in applications or other such projects.
  23. //
  24. // LexTek International
  25. // 2255 N. University Parkway, Suit 15
  26. // Provo, UT 84604
  27. // (801) 375.8332  Phone
  28. // (801) 375.7654  Fax 
  29. //
  30. // ----------------------------------------------------------------------------------
  31. // History:
  32. //    8/26/94        Clark Goble    Original
  33. //
  34.  
  35. #include "EventLoop.h"
  36. #include "MenuHandler.h"
  37. #include "AEHandler.h"
  38. #include "Globals.h"
  39. #include "SpellWright.h"
  40. #include "SpellHandler.h"
  41.  
  42. void main(void);
  43.  
  44. extern void InitToolBox(short numberOfMasters);
  45. extern void DoEvent(void);
  46. extern void BuildMenuBars(void); 
  47.  
  48. // ----------------------------------------------------------------------------------
  49.  
  50. void main(void)
  51. {
  52.     InitToolBox(4);
  53.     
  54.     // free the memory used by the initialization routines
  55.     UnloadSeg(InitToolBox);
  56.     
  57.     // create the SpellChecker global variables
  58.     gtheSpeller = StartSpellCheckSession();    
  59.     gDocWindow = nil;
  60.     
  61.     BuildMenuBars();
  62.     if (!gSys7)
  63.         return;
  64.         
  65.     InitAEHandlers();
  66.  
  67.     InitMainDict();
  68.  
  69.     // here is the actual program
  70.     DoEvent();
  71.     
  72.     // delete the SpellChecker global variables
  73.     EndSpellCheckSession(gtheSpeller);
  74.  
  75. } // main